﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AVISOutBound.SSOServer.Payment.Wechat
{
    /// <summary>
    /// 微信支付参数
    /// </summary>
    public class WechatPayParam
    {
        /// <summary>
        /// 微信应用ID
        /// </summary>
        public string AppId { get; set; }

        /// <summary>
        /// 微信支付——商户ID
        /// </summary>
        public string MchId { get; set; }

        /// <summary>
        /// 微信支付——商户支付密匙
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 微信支付——设备号
        /// </summary>
        public string DeviceInfo { get; set; }

        /// <summary>
        /// 微信支付——服务端IP地址
        /// </summary>
        public string ServiceIpAddress { get; set; }        

        /// <summary>
        /// 交易类型
        /// </summary>
        public TradeType TradeType { get; set; }

        /// <summary>
        /// 域名
        /// </summary>
        public string Domain { get; set; }

        /// <summary>
        /// 商品描述
        /// </summary>
        public string Body { get; set; }

        /// <summary>
        /// 商品名称明细列表
        /// </summary>
        public string Detail { get; set; }

        /// <summary>
        /// 附加参数。
        /// 在查询API和支付通知中原样返回，该字段主要用于商户携带订单的自定义数据
        /// </summary>
        public string Attach { get; set; }

        /// <summary>
        /// 商品单ID
        /// </summary>
        public string OutTradeNo { get; set; }

        /// <summary>
        /// 结算货币，默认人民币：CNY
        /// </summary>
        public string FeeType { get; set; } = "CNY";

        /// <summary>
        /// 支付金额。单位：元
        /// </summary>
        public decimal TotalFee { get; set; }

        /// <summary>
        /// 回调Url，支付成功或失败回调的Url
        /// </summary>
        public string NotifyUrl { get; set; }

        /// <summary>
        /// 微信用户标识，trade_type=JSAPI，此参数必传，用户在商户appid下的唯一标识。
        /// </summary>
        public string Openid { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; }=DateTime.Now;

        /// <summary>
        /// 过期时间。默认：30分钟
        /// </summary>
        public DateTime ExpireTime { get; set; }=DateTime.Now.AddHours(0.5);

        /// <summary>
        /// Wap地址
        /// </summary>
        public string WapUrl { get; set; }

        /// <summary>
        /// Wap名称
        /// </summary>
        public string WapName { get; set; }

        /// <summary>
        /// 初始化一个<see cref="WechatPayParam"/>类型的实例
        /// </summary>
        public WechatPayParam()
        {
            this.Body = "";
            this.FeeType = "CNY";
        }
    }
}
